//初始获取验证码
getCodeImage()
//表单格式化
form.require(
	"#loginForm",
	true,
	[
		{ name: "username", length: [4, 10], to: () => Modal.toast("请输入4到10位用户名！") },
		{ name: "password", length: [6, 20], to: () => Modal.toast("请输入6到20位密码！") },
		{ name: "verify", length: [4, 4], to: () => Modal.toast("请输入4位验证码！") }
	],
	({ password: { password }, text: { username, verify } }, empty, detail) => {
		!empty && !detail && login(username, password, verify, 0) //进入登录
	}
)
//设置请求头
ax.headers = { "Content-Type": "application/json" }
//验证码点击更换图片事件
Listener(".codeImage", "click", () => getCodeImage())
